import java.util.Arrays;
import java.util.Scanner;

public class Test {
    //消失的数字
    //先排序，在找数字

    public static int findNum(int [] arr){
        int data = 0;
        for(int i = 0; i < arr.length; ++i){
            data ^= arr[i];
            data ^= i;
        }
        data ^= arr.length;
        return data;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int [] array = {0,1,2,3,4,5,6,8};

        System.out.println(findNum(array));
    }

}
